<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>通用后台管理系统</title>
  <link rel="stylesheet" href="__STATIC__/css/login.css">
  <script src="__STATIC__/js/jquery-1.11.2.min.js"></script>
  <script src="__STATIC__/layui2.5.4/layui.js"></script>
</head>
<body class="login-bg">
<canvas id="fullstarbg">你的浏览器不支持canvas标签</canvas>
<div class="login">
  <div class="message">通用后台系统by斯兔</div>
  <div id="darkbannerwrap"></div>
  <form method="post" class="layui-form">
    <input name="account" placeholder="用户名" type="text" lay-verify="required" value="admin" class="layui-input">
    <hr class="hr15">
    <input name="password" lay-verify="required" placeholder="密码" type="password" value="123456" class="layui-input">
    <hr class="hr15">
    <input value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
    <hr class="hr20">
  </form>
</div>
<script>
    layui.use(['form'],
      function () {
          $ = layui.jquery;
          var form = layui.form;
          var layer = layui.layer;
          //监听提交
          form.on('submit(login)', function (data) {
              // console.log(data);
              var index = layer.load(0, {shade: false}); //0代表加载的风格，支持0-2
              $.ajax({ //异步请求返回给后台
                  url: "{:url(\"/admin/public/checklogin\")}",
                  type: 'POST',
                  data: data.field,
                  dataType: 'json',
                  success: function (res) {
                      layer.close(index);
                      if (res.code==1) {
                          // $('#Dialog').dialog('close');
                          window.location = "{:url('/admin/Index/index')}";
                      }
                      layer.msg(res.msg);
                  }
              });
              return false;
          });
      });
</script>
<!-- 底部结束 -->
</body>
</html>